﻿using PeiYue.Common.Helper;
using System;
using System.Collections.Generic;

namespace PeiYue.Model.Dto.User
{
    public class SearchUserDto : BaseRequestDto
    {
        public string login_name { get; set; }
        public long department_id { get; set; }
        public int types { get; set; }
    }

    public class sysUserInfoDto
    {
        //public DateTime dd { get; set; } = DateTime.Now;
        public long uID { get; set; }
        /// <summary>
        /// 登录账号
        /// </summary> 
        public string uLoginName { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary> 
        public string uRealName { get; set; }
        /// <summary>
        /// 状态
        /// </summary> 
        public int uStatus { get; set; }
        /// <summary>
        /// 备注
        /// </summary> 
        public string uRemark { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>

        public System.DateTime uCreateTime { get; set; } = DateTime.Now;
        public string CreateTime { get { if (uCreateTime > DateTime.Now.AddYears(-10)) return uCreateTime.ToString("yyyy/MM/dd hh:mm:ss"); else return ""; } }
        /// <summary>
        /// 更新时间
        /// </summary> 
        public DateTime uUpdateTime { get; set; } = DateTime.Now;
        public string UpdateTime { get { if (uUpdateTime > DateTime.Now.AddYears(-10)) return uUpdateTime.ToString("yyyy/MM/dd hh:mm:ss"); else return ""; } }

        /// <summary>
        ///最后登录时间 
        /// </summary>
        public DateTime uLastErrTime { get; set; } = DateTime.Now;

        /// <summary>
        ///错误次数 
        /// </summary>
        public int uErrorCount { get; set; }

        public long department_id { get; set; }

        public int types { get; set; }
        //绑定关系
        public long res_id { get; set; }


        //// 性别 
        //public int sex { get; set; } = 0;
        //// 生日 
        //public DateTime birth { get; set; } = DateTime.Now.AddYears(-20);
        //// 地址 
        //public string addr { get; set; }

        //public bool tdIsDelete { get; set; }


        public List<int> RIDs { get; set; }
        public List<string> RoleNames { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string DepartmentName { get; set; }
        /// <summary>
        /// 类型名称
        /// </summary>
        public string TypeName { get; set; }


        /// <summary>
        /// 状态名称
        /// </summary>
        public string status_names { get { return EnumHelper.GetEnumDesc<CommonEnum.Status>(uStatus); } }


        public long create_user { get; set; }

        //[JsonIgnore]
        public long update_user { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string create_names { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string update_names { get; set; }


        public string res_name { get; set; }
    }



}
